﻿#ifndef TURNTABLEDECODEBASE_H
#define TURNTABLEDECODEBASE_H

class TurnTableDecodeBase
{
public:
  explicit TurnTableDecodeBase(){}
  virtual ~TurnTableDecodeBase(){}
public:
  virtual void decode(char* const data,unsigned int deviceId)
  {
    (void)data;
    (void)deviceId;
  }
  int dataBodyToInt(char* srcData,int dataBodyNum)
  {
    return *(int*)(srcData+4 * dataBodyNum - 1);
  }

  float dataBodyToFloat(char *srcData, int dataBodyNum)
  {
    return (*(int*)(srcData+4 * dataBodyNum - 1) * 0.00001);
  }
};

#endif // TURNTABLEDECODEBASE_H
